<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveResource::Response</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveResource::Response</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/activeresource/lib/active_resource/http_mock_rb.html">
                vendor/rails/activeresource/lib/active_resource/http_mock.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001234">==</a>&nbsp;&nbsp;
      <a href="#M001232">[]</a>&nbsp;&nbsp;
      <a href="#M001233">[]=</a>&nbsp;&nbsp;
      <a href="#M001230">new</a>&nbsp;&nbsp;
      <a href="#M001231">success?</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">body</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">code</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">headers</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">message</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M001230" class="method-detail">
        <a name="M001230"></a>

        <div class="method-heading">
          <a href="#M001230" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(body, message = 200, headers = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001230-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001230-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activeresource/lib/active_resource/http_mock.rb, line 175</span>
175:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">body</span>, <span class="ruby-identifier">message</span> = <span class="ruby-value">200</span>, <span class="ruby-identifier">headers</span> = {})
176:       <span class="ruby-ivar">@body</span>, <span class="ruby-ivar">@message</span>, <span class="ruby-ivar">@headers</span> = <span class="ruby-identifier">body</span>, <span class="ruby-identifier">message</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">headers</span>
177:       <span class="ruby-ivar">@code</span> = <span class="ruby-ivar">@message</span>[<span class="ruby-value">0</span>,<span class="ruby-value">3</span>].<span class="ruby-identifier">to_i</span>
178: 
179:       <span class="ruby-identifier">resp_cls</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPResponse</span><span class="ruby-operator">::</span><span class="ruby-constant">CODE_TO_OBJ</span>[<span class="ruby-ivar">@code</span>.<span class="ruby-identifier">to_s</span>]
180:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp_cls</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">resp_cls</span>.<span class="ruby-identifier">body_permitted?</span>
181:         <span class="ruby-ivar">@body</span> = <span class="ruby-keyword kw">nil</span>
182:       <span class="ruby-keyword kw">end</span>
183: 
184:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">nil?</span>
185:         <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Content-Length'</span>] = <span class="ruby-value str">&quot;0&quot;</span>
186:       <span class="ruby-keyword kw">else</span>
187:         <span class="ruby-keyword kw">self</span>[<span class="ruby-value str">'Content-Length'</span>] = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">to_s</span>
188:       <span class="ruby-keyword kw">end</span>
189:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001234" class="method-detail">
        <a name="M001234"></a>

        <div class="method-heading">
          <a href="#M001234" class="method-signature">
          <span class="method-name">==</span><span class="method-args">(other)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001234-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001234-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activeresource/lib/active_resource/http_mock.rb, line 203</span>
203:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
204:       <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">other</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Response</span>))
205:         <span class="ruby-identifier">other</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">body</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">message</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">headers</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">headers</span>
206:       <span class="ruby-keyword kw">else</span>
207:         <span class="ruby-keyword kw">false</span>
208:       <span class="ruby-keyword kw">end</span>
209:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001232" class="method-detail">
        <a name="M001232"></a>

        <div class="method-heading">
          <a href="#M001232" class="method-signature">
          <span class="method-name">[]</span><span class="method-args">(key)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001232-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001232-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activeresource/lib/active_resource/http_mock.rb, line 195</span>
195:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
196:       <span class="ruby-identifier">headers</span>[<span class="ruby-identifier">key</span>]
197:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001233" class="method-detail">
        <a name="M001233"></a>

        <div class="method-heading">
          <a href="#M001233" class="method-signature">
          <span class="method-name">[]=</span><span class="method-args">(key, value)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001233-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001233-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activeresource/lib/active_resource/http_mock.rb, line 199</span>
199:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
200:       <span class="ruby-identifier">headers</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
201:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001231" class="method-detail">
        <a name="M001231"></a>

        <div class="method-heading">
          <a href="#M001231" class="method-signature">
          <span class="method-name">success?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001231-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001231-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activeresource/lib/active_resource/http_mock.rb, line 191</span>
191:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">success?</span>
192:       (<span class="ruby-value">200</span><span class="ruby-operator">..</span><span class="ruby-value">299</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">code</span>)
193:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>